<?php

namespace App\Http\Controllers\H5;

use App\Http\Controllers\Controller;

use App\Models\Popularity;
use App\Models\Singer;
use Illuminate\Support\Facades\Input;
use Illuminate\Support\Facades\Request;


class IndexController extends Controller
{


    public function index()
    {

        $data = [];

        return view('h5.home');
    }

    public function getAbout()
    {
        return view('h5.about');
    }

    public function getBaoming()
    {
        $params = Input::all();

        if (isset($params['team'])) {
            return view('h5.enter-team');
        }

        return view('h5.enter-personal');
    }

    public function getHot()
    {
        $Popularity = new Popularity();

        $qishu = $Popularity->max('qishu');


        $list = $Popularity->with('singer')->where('qishu', $qishu)->get()->toArray();


        $old = $Popularity->with('singer')->where('qishu', $qishu - 1)->get()->toArray();

        return view('h5.hot', compact('list', 'old'));
    }

    public function getDetail($id)
    {
        $singer = new Singer();
        $singer = $singer->find($id)->toArray();

        return view('h5.share', compact('singer'));
    }


    public function getJuesai()
    {
        return view('h5.hot');
    }


    public function getSuccess()
    {
        return view('h5.success');
    }

}
